﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HenIT.Data.SqlClient;
using System.Data.SqlClient;
using System.Data;
namespace EventScavenger
{
    public partial class EventScavengerDAL : GenericSQLServerDAL
    {
        #region Event sources
        internal List<EventSource> GetEventSourceList()
        {
            List<EventSource> list = new List<EventSource>();
            string sql = "SelectSourceList2";
            DataSet dsSources = base.GetDataSet(sql, CommandType.StoredProcedure);
            if (dsSources.Tables.Count > 0)
            {
                list.AddRange(
                    from DataRow r in dsSources.Tables[0].Rows
                    select new EventSource() { SourceID = (int)r["SourceID"], Source = r["Source"].ToString() }
                    );
            }

            return list;
        }
        #endregion
    }
}
